;    s.ModeExHdr
;
;******************************************************************************
;
;    This file is assembled with ObjAsm to an object file. This is linked with
;    another object file containing the body of ModeEx to form a relocatable
;    module providing an extra 'soft' screen mode: Mode 63.
;
;    The module header code included here may be useful for adjustment to form
;    the headers of other relocatable modules.
;
;    Points demonstrated here include:
;        - Constructing a relocatable module using assembly language
;        - ObjAsm directives
;        - GETting header files
;

; Use the GET directive to include a list of SWI names as if typed here

        GET     ^.AsmHdrs.h.SWINames

; symbol IMPORTs and AREA directive

        AREA    |!!!Module$$Header|, CODE, READONLY

        IMPORT  |__RelocCode|            ; Link symbol for relocation routine

        IMPORT  |ModeEx_Service|         ; service call handler in RM body

;******************************************************************************
;
;   Module code starts here
;

        ENTRY

Module_BaseAddr
        DCD     RM_Start   -Module_BaseAddr
        DCD     RM_Init    -Module_BaseAddr
        DCD     RM_Die     -Module_BaseAddr
        DCD     RM_Service -Module_BaseAddr  ; IMPORTed
        DCD     RM_Title   -Module_BaseAddr
        DCD     RM_HelpStr -Module_BaseAddr
        DCD     RM_HC_Table-Module_BaseAddr

RM_Title
        =       "ModeEx", 0

RM_HelpStr
        =       "ModeEx", 9, 9
        =       "0.02 (02 Dec 1994)", 0
        ALIGN

;******************************************************************************
;
;       RM_Start - Start entry point for entry as current application
;

RM_Start * Module_BaseAddr          ; set table entry to zero, as ModeEx is
                                    ; only a service module, not an application

;******************************************************************************
;
;       RM_Init - Initialisation entry point
;

RM_Init 
        STMDB   r13!, {r14}
        BL      |__RelocCode|       ; initialise absolute code pointers

; if any workspace is needed, claim it here

        LDMIA   r13!, {r15}

;******************************************************************************
;
;       RM_Die - Die entry
;

; if any workspace is needed, free it here

RM_Die * Module_BaseAddr            ; set table entry to zero

;******************************************************************************
;
;       RM_Service - Service call handler
;

RM_Service
        B       |ModeEx_Service|    ; jump to routine in module body

;******************************************************************************
;
;       RM_HC_Table - Help and command keyword table
;

RM_HC_Table * Module_BaseAddr       ; set table entry to zero
                                    ; as module supports no *commands


        END
